<fieldset>
    <div class="widget">
        <div class="title"> <?= image_tag('icons/dark/stats.png', array("class" => "titleIcon")); ?><h6>Due Sheet</h6></div>
        <div class="ressultDiv">
            <h3 style="color: dimgray;margin: 13px;">Today: <span style="color: darkgrey;font-size: 18px;"><?= date('d M Y', time()) ?></span></h3>
            <table cellspacing="0" cellpadding="0" width="100%" class="sTable" >
                <thead>
                    <tr style="border-top: 1px solid #dbdbdb;border-bottom: 3px solid #dbdbdb;">
                        <td style="color: #4D79B3;font-size: 15px;font-weight: bold;width: 15%;">Customer Name</td>
                        <td style="color: #4D79B3;font-size: 15px;font-weight: bold;">Balance</td>
                        <td style="color: #4D79B3;font-size: 15px;font-weight: bold;">30 Days</td>
                        <td style="color: #4D79B3;font-size: 15px;font-weight: bold;">60 Days</td>
                        <td style="color: #4D79B3;font-size: 15px;font-weight: bold;">90 Days</td>
                        <td style="color: #4D79B3;font-size: 15px;font-weight: bold;">90 &#8593; Days</td>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($result as $record) : ?>
                        <tr style="border-bottom: 3px solid #dbdbdb;">
                            <td align="center"><strong><?= $record['customer_name'] ?></strong></td>
                            <td align="center"><strong class="<?= (($record['30day'] + $record['60day'] + $record['90day'] + $record['90daysup'])) ? 'red' : ''; ?>"><?= number_format($record['30day'] + $record['60day'] + $record['90day'] + $record['90daysup'], 2) ?></strong></td>
                            <td align="center"><strong class="<?= ($record['30day']) ? 'red' : ''; ?>"><?= number_format($record['30day'], 2) ?></strong></td>
                            <td align="center"><strong class="<?= ($record['60day']) ? 'red' : ''; ?>"><?= number_format($record['60day'], 2) ?></strong></td>
                            <td align="center"><strong class="<?= ($record['90day']) ? 'red' : ''; ?>"><?= number_format($record['90day'], 2) ?></strong></td>
                            <td align="center"><strong class="<?= ($record['90daysup']) ? 'red' : ''; ?>"><?= number_format($record['90daysup'], 2) ?></strong></td>
                        </tr>
                    <?php endforeach; ?>
                </tbody>
                <tfoot>
                </tfoot>
            </table>

        </div>
</fieldset>